package cn.pegasus.teamwork.pegasus.service;

import java.util.Map;

import com.aliyuncs.exceptions.ClientException;

import cn.iyizhan.teamwork.base.service.BaseService;
import cn.iyizhan.teamwork.base.util.PageObject;
import cn.pegasus.teamwork.pegasus.entity.BussUserConsumorder;
import cn.pegasus.teamwork.pegasus.entity.BussUserOrder;
import cn.pegasus.teamwork.pegasus.entity.BussUserReward;
import cn.pegasus.teamwork.pegasus.mapper.BussUserOrderMapper;

/**
 * @author ryan.bian
 * @version 
 */
public interface BussUserOrderService extends BaseService<BussUserOrder,BussUserOrderMapper>  {
	
	/**
	 * 处理退款资金变动情况
	 * @return
	 */
	public void handleRefundsOrderMoney(BussUserOrder bo);
	
	/**
	 * 洗车工完成服务订单时候，资金变化
	 * @return
	 */
	public void finishServiceMoney(BussUserOrder bo);
	
	/**
	 * 处理用户充值之后时候的资金变动情况
	 * @return
	 */
	public void handleUserRechargeMoney(BussUserConsumorder cvo);
	
	/**
	 * 处理用户充值之后时候的资金变动情况
	 * @return
	 */
	public void handleUserRewardMoney(BussUserReward br);
	
	/**
	 * 用户退款业务处理
	 * @param map
	 */
	public int modifyRefunds(Map<String, Object> map) throws ClientException;
	
	/**
	 * 用户取消订单处理
	 * @param transaction_id
	 * @param orderBalance
	 * @param orderNo
	 * @return
	 */
	public boolean cancelOrder(Map<String, Object> map) throws ClientException;
	
	/**
	 * 用户对创建的订单进行支付
	 * @param map
	 */
	public Map<String,Object> choiceTimes(Map<String, Object> map);
					 
	//分页查询
	public PageObject<BussUserOrder> PageList(Map<String, Object> map);
	
	// 已完成订单查询，特殊处理
	public PageObject<BussUserOrder> pageQueryByForList(Map<String, Object> map);
	
	//查看详情
	public BussUserOrder findRoderInfo(Long id);
	
	//查看详情
	public BussUserOrder findOrderInfoByLogin(Map<String,Object> map);
	
	//审核
	public void examine(Long id,Integer status) throws Exception;
	
	//定时任务结算
	public void settlement() throws Exception;
	
	public int getRefundsCountByWasher(Map<String,Object> map);
	
	/**
	 * 创建用户购买订单
	 * @param map
	 * @return
	 */
//	public Map<String, Object> createPurchaseOrder(Map<String, Object> map);
	
	/**
	 * 创建用户购买订单
	 * @param map
	 * @return
	 */
	public String createPurchaseOrders(Map<String, Object> map);
	
	/**
	 * 充值订单回调业务处理
	 * @param transaction_id
	 * @param orderBalance
	 * @param orderNo
	 * @return
	 */
	public boolean modifyPurchaseOrder(String transaction_id,String orderBalance,String orderNo) throws ClientException;
	
	/**
	 * 用户使用账户余额进行订单创建
	 * @param map
	 */
//	public String createAccountOrder(Map<String, Object> map) throws ClientException;
	
	/**
	 * 用户使用账户余额进行订单支付
	 * @param map
	 */
	public int payAccountOrder(Map<String, Object> map) throws ClientException;
	
	/**
	 * 用户使用账户余额进行订单支付
	 * @param map
	 */
	public Map<String, Object> payWxOrder(Map<String, Object> map) throws ClientException;
	
	/**
	 * 创建用户打赏订单
	 * @param map
	 * @return
	 */
	public Map<String, Object> createRrewardOrder(Map<String, Object> map);
	
	/**
	 * 打赏订单回调业务处理
	 * @param transaction_id
	 * @param orderBalance
	 * @param orderNo
	 * @return
	 */
	public boolean modifyRrewardOrder(String transaction_id,String orderBalance,String orderNo);
	
	/**
	 * 创建用户打赏订单余额支付
	 * @param map
	 * @return
	 */
//	public String createAccountRrewardOrder(Map<String, Object> map);
	
	/**
	 * 用户使用账户余额进行订单支付
	 * @param map
	 */
	public int payAccountRrewardOrder(Map<String, Object> map) throws ClientException;
	
	/**
	 * 洗车工还未开始的订单总数
	 * @param map
	 * @return
	 * @throws ClientException
	 */
	public int findOrderInfoBySpoke(Map<String, Object> map) throws ClientException;
	
	
	/**
	 * 退款订单回调业务处理
	 * @param transaction_id
	 * @param orderBalance
	 * @param orderNo
	 * @return
	 */
	public boolean modifyRefundOrder(String transaction_id,String orderBalance,String orderNo);
	
	/**
	 * 洗车工统一退款流程
	 * @param map
	 * @return
	 * @throws ClientException
	 */
	public boolean washerProessRefunds(Map<String, Object> map) throws ClientException;
}
